<template>
    <div class="xjyouhuinav">
        <van-tabbar v-model="active" style="color:#FFEEE1">
            <van-tabbar-item v-for="(item, index) in youhuinav" :key="index"  style="border-right:1px solid #FFEEE1">
                <span >{{ item.text }}</span>
                <template slot-scope="scope">
                    <div class="yhq" >
                        <div style="color:#FF882D">
                            <div style="font-size:18px;    text-align: center;">
                                {{
                                    item.menkan_price > 0
                                        ? '满' + item.menkan_price + '减' + item.jian_price
                                        : '减' + item.jian_price
                                }}
                            </div>
                            <div style="margin-top:5px">
								{{ item.menkan_price > 0 ? ' 满减卷' : '无门槛卷' }}
							</div>
                        </div>
                        <div style="margin-left:15px">
							<div class="yhq_btn" @click="toticket(item.id)">
								点击领券
							</div>
						</div>
                    </div>
                    <!-- <van-icon :name="item.name" :color="item.color" v-if="item.name?true:false" size="2.5rem"/> -->
                    <!-- <i :class="item.class" v-if="item.class?true:false"></i> -->
                </template>
            </van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
export default {
    props: ['youhuinav', 'prevent'],
    data() {
        return {
            active: 0
            // icon: {
            //  active: require('../../assets/img/user-active.png'),
            //  inactive: require('../../assets/img/user-inactive.png')
            // },
        };
    },
    methods: {
		toticket(id){
			// console.log(id)
			if(this.$route.path!='/custom/customPhone'){
				// this.$router.push({path:})
                this.$router.push(`ticket?id=${id}`);
				// this.$router.push({ name: 'ticket',query:{id}});
			}
		},
        // clickTuWen(url) {
        //     if (this.prevent) {
        //         return;
        //     }
        //     location.href = url;
        // }
    },
    created() {
		// console.log(this.youhuinav)
	}
};
</script>

<style lang="scss" scoped>
.xjyouhuinav {
    margin: 10px 0;
	padding: 10px;
	background-color: #FFEEE1 !important;
    .van-tabbar--fixed {
        position: relative;
        z-index: 0;
    }
    .van-tabbar-item__icon img {
        //width: 2rem;
        height: 2.5rem;
    }
}
.yhq{
	display: flex;
	margin-right: 10px;
}
.yhq_btn{
	width: 60px;
	text-align: center;
	height: 20px;
	margin: 10px 5px;
	line-height: 20px;
	border-radius: 10px;
	background-color: #FF882D;
	color: #FFF;
}
</style>